package org.KeyCrafter.obj;

import org.KeyCrafter.obj.type.Encoded;

public abstract class AbstractKeyCrafterObj<T extends Encoded> implements KeyCrafterObject {
    //protected byte type;
    // 编码
    //protected byte encoding;
    // 对象最后一次被访问的时间
    protected int lru;
    // 实际值
    protected T value;

    @Override
    public byte getEncoding() {
        return value.encoding();
    }
    @Override
    public int getLRU() {
        return this.lru;
    }
    @Override
    public void setLRU(int lru) {
        this.lru = lru;
    }
    @Override
    public T getValue() {
        return this.value;
    }
    public AbstractKeyCrafterObj(T value) {
        this.value = value;
    }
}
